import Vue from 'vue'
import VueRouter from 'vue-router'
import Foot from '@/components/footer.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/homeHot'
  },
  {
    path: '/homeHot',
    name: 'homeHot',
    components: {
      default: () => import('@/views/homeHot/index.vue'),
      foot: Foot
    }
  },
  {
    path: '/cinema',
    name: 'cinema',
    components: {
      default: () => import('@/views/cinema/index.vue'),
      foot: Foot
    }
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('@/views/register/index.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/user',
    name: 'user',
    components: {
      default: () => import('@/views/user/index.vue'),
      foot: Foot
    }
  },
  {
    path: '*',
    name: '404',
    component: () => import('@/views/404/index.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
